﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;

using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;


public partial class ChangePassword : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void btSave_Click(object sender, EventArgs e)
    {
        string sUsername = Session["Username"].ToString();
        DataTable dtUsername = BusLogic.Administrator.get_ADMINISTRATOR(sUsername).Tables[0];

        string sPassword = dtUsername.Rows[0]["PASSWORD"].ToString();
        if (sPassword.Contains(txtPasswordOld.Text))
        {
            BusLogic.Administrator.change_PASSWORD(sUsername, txtPasswordNew.Text);

            ltSuccess.Text = "Đổi mật khẩu thành công !";
        }
        else
        {
            ltSuccess.Text = "Đổi mật khẩu thất bại !";
        }
    }
}
